package training;

public class fib {


    public static void main(String[] args) {

        int N = 12;


        // 0 ,1 ,1,2,3,5
        System.out.println(fib(3));

    }


    public static int fib(int n) {

        if (n == 0)
            return 0;

        int a = 0;

        int b = 1;

        int c = b;

        int i = 1;

        while (i < n) {
            b = c;
            c = a + b;
            a = b;
            i++;
        }

        return c;
    }


}
